local juguan_active = fk.CreateSkill {
  name = "juguan_active"
}

Fk:loadTranslationTable{
  ["juguan_active"] = "拒关",
}

local function CountNameNum(card)
  if card.name == "lvshi__blade" then
    return 3
  elseif card.name == "lvshi__crossbow" then
    return 2
  end
  return Fk:translate(card.trueName, "zh_CN"):len()
end

juguan_active:addEffect("active", {
  mute = true,
  card_num = 2,
  target_num = 0,
  card_filter = function(self, player, to_select, selected)
    local card = Fk:getCardById(to_select)
    if #selected == 0 then
      return true
    elseif #selected == 1 then
      return CountNameNum(card) == CountNameNum(Fk:getCardById(selected[1]))
    else
      return false
    end
  end,
})

return juguan_active
